/**
 * (created at 2011-1-21)
 */
package qiushuo.mysqlparser.ast.expression.primary.literal;

import qiushuo.mysqlparser.ast.expression.primary.PrimaryExpression;
import qiushuo.mysqlparser.generator.SQLType;

/**
 * @author <a href="mailto:QiuShuo1985@gmail.com">QIU Shuo</a>
 */
public class LiteralHexadecimal extends PrimaryExpression {
    private final String text;

    /** attention the syntax: <code>(introducer)? 0x1c2f</code> */
    public LiteralHexadecimal(String hexadecimalText) {
        this.text = hexadecimalText;
    }

    @Override
    public String generateSql(SQLType type) {
        switch (type) {
        case MySQL:
            return text;
        default:
            throw new UnsupportedOperationException("only mysql sql can be generated");
        }
    }
}
